<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//<object>
				
			//1.创建对象
			var obj1 = new Object("abc123");
			console.log(obj1);
			console.log(obj1.constructor);
			
			var stu = {};
			stu.id = 1;
			stu.name = "中山";
			stu.age = 18;
			
			console.log(stu.id+","+stu.name);
			console.log(stu);
			console.log(stu.constructor);
			
			var stu2 = {
				id:2,
				name:"ww",
				age:"19"
			}
			console.log(stu2.id+","+stu2.name);
			
			
			var stu3 = {};
			stu3["id"] = 3;
			stu3["name"] = "tuy";
			stu3["age"] = 19;
			console.log(stu3.id+","+stu3.name);
			
			//练习
			//新建对象 保持商品信息
			//name ipone11  编号 1001 价格 8888 颜色玫瑰金
			var obj4 = new Object("abc1234");
			console.log(obj4);
			console.log(obj4.constructor);
			
			var stu4 = {};
			stu.id = 1001;
			stu.name = "ipone15";
			stu.price = 8888;
			stu.color = "玫瑰金"
			console.log(stu4.id+","+stu4.name+","+stu4.price+","+stu4.color);
			console.log(stu4);
			console.log(stu4.constructor);
			
		</script>
	</body>
</html>
